<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CreateConfigRequest extends FormRequest
{
    // protected $errorBag = 'create';
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'sitetitle' =>'required',
            'domain'    =>'required',
            'keyword'   =>'required',
            'desc'      =>'required',
            'closeinfo' =>'required',
        ];
    }
    public function messages(){
        return [
            'sitetitle.required'=>'网站名称必须填写',
            'domain.required'   =>'网站域名必须填写',
            'keyword.required'  =>'关键字必须填写',
            'desc.required'     =>'描述必须填写',
            'closeinfo.required'=>'关站提示必须填写',
        ];
    }
}
